import Vue from 'vue';
import VueRouter from 'vue-router';
// 如果在一个模块化工程中使用它，必须要通过 Vue.use() 明确地安装路由功能：
Vue.use(VueRouter);

// 路由定义
const routes=[
    {
        path:"/",
        name:"home",
        component: Vue.component('home', require( './components/home/index.vue' ).default),
    },
    {
        path:"/detail/:id",
        name:"home",
        component: Vue.component('detail', require( './components/home/detail.vue' ).default),
    },
    {
        path:"/profile",
        name:"profile",
        component: Vue.component('profile', require( './components/user/profile.vue').default),
    },
];
export default new VueRouter({
    mode: 'history',
    routes:routes
})
